<!--
 * @Description: 
 * @Author: 赵渝航
 * @Date: 2021-03-05 16:08:57
 * @LastEditTime: 2021-03-05 16:43:14
 * @LastEditors: Please set LastEditors
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var iArray = [];
    function getRandom(istart, iend){
      var iChoice = Math.abs(istart - iend +1);
      return Math.floor(Math.random() * iChoice) + istart;
    }

    for(var i=0; i<10; i++){
      iArray.push(getRandom(10,100));
    }
    iArray.sort();
    
    console.log(iArray);


    function serilizeUrl(url) {
      var result = {};
      url = url.split("?")[1];
      var map = url.split("&");
      for(var i = 0, len = map.length; i < len; i++) {
        result[map[i].split("=")[0]] = map[i].split("=")[1];
      }
      return result;
    }

    let url = "www.baidu.com?a=1&b=2";
    console.log(serilizeUrl(url));

    for(var i = 0; i < 10; i++){
      (function (j){
        setTimeout(function(){
          console.log(j+1)
        }, j*1000)
      })(i)
    }

    let a = {
 value: 1 }
function getValue(name, age) {
 console.log(name)
 console.log(age)
 console.log(this.value) }
getValue.call(a, 'yck', '24')
getValue.apply(a, ['yck', '24'])

  </script>
</body>
</html>